// 统一管理用户相关的接口
import request from "@/utils/request";
import type { LogUploadForm, LogListForm, LogListResponseData, LogDetailResponseData } from "./type.ts";
// 统一管理接口
enum API {
    UPLOADOREDIT_URL = "/need/log/uploadLog",
    GETLOGLIST_URL = "/need/log/getLogList",
    GETDETAIL_URL = "/need/log/getLogInfo",
    DELETE_URL = "/need/log/removeLog",
}

// 暴露请求函数
export const reqUploadLog = (data: LogUploadForm) => {
    return request.post<any, ResponseData<string>>(API.UPLOADOREDIT_URL, data);
};
// 获取日志列表
export const reqLogList = (data: LogListForm) => request.post<any, LogListResponseData>(API.GETLOGLIST_URL, data);
// 获取日志详细内容
export const reqLogDetail = (id: number) => request.post<any, LogDetailResponseData>(API.GETDETAIL_URL, { id });
// 删除日志
export const reqDeleteLog = (id: number) => request.post<any, ResponseData<string>>(API.DELETE_URL, { id });
